package com.zhangst.bbs.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zhangst.bbs.dao.BaseDaoI;
import com.zhangst.bbs.domain.Cate;
import com.zhangst.bbs.service.CateServiceI;

@Service("cateService")
public class CateServiceImpl implements CateServiceI{
	BaseDaoI<Cate> cateDao;
	
	
	
	public BaseDaoI<Cate> getCateDao() {
		return cateDao;
	}
	@Autowired
	public void setCateDao(BaseDaoI<Cate> cateDao) {
		this.cateDao = cateDao;
	}

	@Override
	public void add(Cate cate) {
		cateDao.save(cate);
		
	}

	@Override
	public void del(Cate cate) {
		cateDao.delete(cate);
	}

	@Override
	public void edit(Cate cate) {
		cateDao.update(cate);
		
	}

	@Override
	public List<Cate> getCates() {
		String hql = "from Cate";
		return cateDao.find(hql);
	}

}
